import { RouteRecordRaw } from 'vue-router'
import Layout from '../layout/index.vue'
export const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [
      {
        path: 'home',
        component: () => import('./../views/home/index.vue'),
        meta: {
          title: '系统首页',
          icon: 'home'
        }
      }
    ]
  },
  {
    path: '/banner',
    component: Layout,
    redirect: '/banner/list',
    meta: { title: '轮播图管理', icon: 'windows' },
    children: [
      {
        path: 'list',
        component: () => import('./../views/banner/index.vue'),
        meta: { title: '轮播图列表', icon: 'windows' }
      },
      {
        path: 'add',
        component: () => import('./../views/banner/add.vue'),
        meta: { title: '添加轮播图', icon: 'windows' }
      }
    ]
  },
  {
    path: '/pro',
    component: Layout,
    redirect: '/pro/list',
    meta: { title: '产品管理', icon: 'windows' },
    children: [
      {
        path: 'list',
        component: () => import('./../views/pro/index.vue'),
        meta: { title: '产品列表', icon: 'windows' }
      },
      {
        path: 'seckill',
        component: () => import('./../views/pro/seckill.vue'),
        meta: { title: '秒杀列表', icon: 'windows' }
      },
      {
        path: 'recommend',
        component: () => import('./../views/pro/recommend.vue'),
        meta: { title: '推荐列表', icon: 'windows' }
      },
      {
        path: 'search',
        component: () => import('./../views/pro/search.vue'),
        meta: { title: '筛选商品', icon: 'windows' }
      }
    ]
  },
  {
    path: '/user',
    component: Layout,
    redirect: '/user/list',
    meta: { title: '用户管理', icon: 'windows' },
    children: [
      {
        path: 'list',
        component: () => import('./../views/user/index.vue'),
        meta: { title: '用户列表', icon: 'windows' }
      },
      {
        path: 'admin',
        component: () => import('./../views/user/admin.vue'),
        meta: { title: '管理员列表', icon: 'windows' }
      }
    ]
  }
]
